<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no" />
    <link rel="stylesheet" href="css/style.css" />
    <link rel="stylesheet" href="css/iconfont.css" />
    <script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
    <link href="css/mobiscroll.javascript.min.css" rel="stylesheet" type="text/css" />
    <script src="js/mobiscroll.javascript.min.js" type="text/javascript"></script>
    <script src="js/mock.js"></script>
    <title>購物車</title>
</head>

<body class="minipage">
    <div class="wrap">
        <div class="logocon">
            <div class="logoimg "><img src="./img/logo.png "></div>
            <div class="cont ">
                <p>O2O客戶服務平台（EC2）</p>
                <p>請關注粉絲專頁 <a href="javascript ">福皓整合科技</a></p>
            </div>
            <!-- <div class="sharecon ">
                <iframe src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2FFull2house%2F&amp;width=50&amp;layout=box_count&amp;action=like&amp;size=large&amp;show_faces=false&amp;share=false&amp;height=65&amp;appId=382298112140973 "
                    width="50 " height="50 " style="border:none;overflow:hidden " scrolling="no " frameborder="0 " allowtransparency="true "></iframe>
            </div> -->
        </div>
        <section class="shopping">
            <dl>
                <dt class="topnav clearfix">
                    <div class="fl">
                        <label>
                            <input name="shopping-all-check" type="checkbox" value="1" class="ace">
                            <span class="lbl">  全選</span>
                        </label>
                    </div>
                    <div class="del fr"><a href="javascript:;" class="btn-gray-o"> 刪除 </a></div>
                </dt>
                <dd class="ec_goods clearfix">
                    <div class="fl width-10">
                        <label>
                            <input name="shopping-check" type="checkbox" value="1" class="ace">
                            <span class="lbl"></span>
                        </label>
                    </div>
                    <div class="ec_div2"><img src="img/ec_pic1.jpg" alt=""></div>
                    <div class="fl width-70 content">
                        <p class="order-number">烤鴨烤鴨好吃的烤鴨烤鴨烤鴨好吃的烤鴨烤鴨烤鴨好吃的烤鴨</p>
                        <div class="numcon clearfix">
                            <span class="fl price"><em>NT$</em><font>798</font></span>
                            <div class="fr clearfix">
                                <div class="cont">
                                    <a class="btn plus jian"><i class="icon iconfont icon-jian"></i></a>
                                    <div class="numberInput">
                                        <input class="num" min="1" type="number" value="1">
                                    </div>
                                    <a class="btn reduce jia"><i class="icon iconfont icon-tianjia"></i></a>
                                    <!-- <button type="button" id="btnSearch" class="btn btnSearch"><i class="fa fa-search" aria-hidden="true"></i></button> -->
                                </div>
                            </div>
                            <!-- <span class="fr"><input type="number" min="0" class="number" value="1"></span> -->
                        </div>
                    </div>
                </dd>
                <dd class="ec_goods clearfix">
                    <div class="fl width-10">
                        <label>
                            <input name="shopping-check" type="checkbox" value="1" class="ace">
                            <span class="lbl"></span>
                        </label>
                    </div>
                    <div class="ec_div2"><img src="img/ec_pic1.jpg" alt=""></div>
                    <div class="fl width-70 content">
                        <p class="order-number">烤鴨烤鴨好吃的烤鴨烤鴨烤鴨好吃的烤鴨烤鴨烤鴨好吃的烤鴨</p>
                        <div class="numcon clearfix">
                            <span class="fl price"><em>NT$</em><font>798</font></span>
                            <div class="fr clearfix">
                                <div class="cont">
                                    <a class="btn plus jian"><i class="icon iconfont icon-jian"></i></a>
                                    <div class="numberInput">
                                        <input class="num" min="1" type="number" value="1">
                                    </div>
                                    <a class="btn reduce jia"><i class="icon iconfont icon-tianjia"></i></a>
                                    <!-- <button type="button" id="btnSearch" class="btn btnSearch"><i class="fa fa-search" aria-hidden="true"></i></button> -->
                                </div>
                            </div>
                            <!-- <span class="fr"><input type="number" min="0" class="number" value="1"></span> -->
                        </div>
                    </div>
                </dd>

            </dl>
            <p class="load_more" data-page="0"></p>
        </section>
        <div class="nav-con">
            <div class="nav clearfix">
                <span class="fl totle"><em>合计：</em>NT$1798</span>
                <a id="buycar" href="" class="btn-green fr navbtn">去買單</a>
            </div>
        </div>
    </div>
    <script type="text/javascript">
    $(function() {

        $(document).on('click', '.jian', function(e) {
            var par=$(this).closest('.cont');
            var num =parseInt(par.find('.num').val());
            if (num == 1) {
                return false;
            }

            num--;
            par.find('.num').val(num);
        });
        $(document).on('click', '.jia', function(e) {
            var par=$(this).closest('.cont');
            var num = parseInt(par.find('.num').val());
            num++;
            par.find('.num').val(num);
        });
        $(document).on('blur', '.num', function(e) {
            var num = $(this).val();
            if (num == ''||num<1) {
                $(this).val('1');
            }
        });
        //删除
        $(document).on('click', '.del', function(e) {
           $('input[name=shopping-check]').each(function(){
            if($(this).prop('checked')==true){
                $(this).closest('.ec_goods').remove();
            }
           })
        });
        //全选
         $(document).on('change', 'input[name=shopping-all-check]', function(e) {
           if($(this).prop('checked')==true){
              $('input[name=shopping-check]').prop('checked',true);
                 
           
           }else{
             $('input[name=shopping-check]').prop('checked',false);
           }
        });



    })
    </script>
</body>

</html>